package uqbar.aspectj.observable.simple;

import uqbar.aspectj.utils.SimpleObject;
import examples.simple.TestObject;

/**
 * @author phm
 */
public class ObservableByFieldExample extends SimpleObject {

	public static void main(String[] args) {
		new ObservableByFieldExample().daleMasa();
	}

	public void daleMasa() {
		TestObject obj = new TestObject();
		
		obj.stringField = "nuevo";
		log();
		
		obj.stringField = ("nuevo2");
		log();

		obj = new TestObject();
		obj.setStringField("masnuevo!");
		log();
	}

	private void log() {
		System.out.println("counter " + SysoutSimpleObservableAspect.aspectOf().counter);
		System.out.println();
	}

}
